@extends('layouts.admin')
@section('content')
		<table class="table table-hover">
			<tr class="active">
			  <th width="30">cid</th>
			  <th>分类名称</th>
				<th>开始时间</th>
				<th>结束时间</th>
			  <th width="210">操作</th>
			</tr>
			@foreach($data as $k=>$v)
			<tr>
				<td>{{$v['aid']}}</td>
				<td>{{$v['ac_name']}}</td>
				<td>{{date("Y-m-d H:i:s",$v['starttime'])}}</td>
				<td>{{date("Y-m-d H:i:s",$v['endtime'])}}</td>
				<td>
					<a href='{{url("admin/action/$v->aid/edit")}}' class="btn btn-sm btn-warning">编辑</a>
					<a href="javascript:;" class="btn btn-sm btn-danger" onclick="delAction({{$v->aid}})">删除</a>
				</td>
			</tr>
			@endforeach
		</table>
		<script type="text/javascript" src="{{asset('public/sytle/uploadify/jquery-1.8.2.min.js')}}"></script>
		<script type="text/javascript" src="{{asset('public/org/layer/layer.js')}}"></script>
		<script>
			function delAction(aid){
				layer.confirm("您确定要删除吗？",{
					btn:['确定','取消']
				}, function(){
					$.post("{{url('admin/action/')}}/"+aid,{"_method":"delete","_token":"{{csrf_token()}}"},function(data){
						if(data.status==0){
							location.href =location.href
							layer.msg(data.message, {icon: 6});
						}else{
							layer.msg(data.message, {icon: 5	});
						}
					},"json");
				}
				)
			}
		</script>
@endsection
